package com.fastloan.mgt.product.temp.controller;

import com.fastloan.mgt.product.temp.model.DefTemp;
import com.fastloan.mgt.product.temp.model.vo.DefTempDTO;
import com.fastloan.mgt.product.temp.service.DefTempService;
import com.kawins.base.baseabs.BaseController;
import com.kawins.result.ResultTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author chenkai
 * createTime 2017-11-2017/11/7 11:26
 */
@RestController
@RequestMapping("/api/web/defTemp")
public class DefTempController extends BaseController<DefTemp> {
    @Autowired
    private DefTempService defTempService;

    /**
     * 获取产品ipc信息
     *
     * @param productId
     * @return
     */
    @GetMapping("/{productId}")
    public ResultTo getDetTemp(@PathVariable String productId) {
        return new ResultTo().setData(defTempService.queryDefTemp(productId));
    }

    @PostMapping
    public ResultTo insertTemp(List<DefTempDTO> tempDTOList) {
        defTempService.insertTemp(tempDTOList);
        return new ResultTo();
    }

}
